﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="AdminUserControl.aspx.cs" Inherits="NuaTarDoneng.AdminUserControl" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" 
    CellPadding="3" DataKeyNames="UserID" DataSourceID="SqlDataSource1" 
    ForeColor="Black" GridLines="Vertical" Height="199px" Width="718px">
    <AlternatingRowStyle BackColor="#CCCCCC" />
    <Columns>
        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
        <asp:BoundField DataField="UserID" HeaderText="UserID" ReadOnly="True" 
            SortExpression="UserID" />
        <asp:BoundField DataField="UserName" HeaderText="UserName" 
            SortExpression="UserName" />
        <asp:BoundField DataField="PassWord" HeaderText="PassWord" 
            SortExpression="PassWord" />
        <asp:BoundField DataField="Tails" HeaderText="Tails" SortExpression="Tails" />
        <asp:BoundField DataField="LinkUps" HeaderText="LinkUps" 
            SortExpression="LinkUps" />
        <asp:BoundField DataField="timeAnchor" HeaderText="timeAnchor" 
            SortExpression="timeAnchor" />
        <asp:BoundField DataField="Role" HeaderText="Role" SortExpression="Role" />
    </Columns>
    <FooterStyle BackColor="#CCCCCC" />
    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
    <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
    <SortedAscendingCellStyle BackColor="#F1F1F1" />
    <SortedAscendingHeaderStyle BackColor="#808080" />
    <SortedDescendingCellStyle BackColor="#CAC9C9" />
    <SortedDescendingHeaderStyle BackColor="#383838" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    DeleteCommand="DELETE FROM [User] WHERE [UserID] = @UserID" 
    InsertCommand="INSERT INTO [User] ([UserID], [UserName], [PassWord], [Tails], [LinkUps], [timeAnchor], [Role]) VALUES (@UserID, @UserName, @PassWord, @Tails, @LinkUps, @timeAnchor, @Role)" 
    SelectCommand="SELECT * FROM [User]" 
    UpdateCommand="UPDATE [User] SET [UserName] = @UserName, [PassWord] = @PassWord, [Tails] = @Tails, [LinkUps] = @LinkUps, [timeAnchor] = @timeAnchor, [Role] = @Role WHERE [UserID] = @UserID">
    <DeleteParameters>
        <asp:Parameter Name="UserID" Type="String" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="UserID" Type="String" />
        <asp:Parameter Name="UserName" Type="String" />
        <asp:Parameter Name="PassWord" Type="String" />
        <asp:Parameter Name="Tails" Type="String" />
        <asp:Parameter Name="LinkUps" Type="String" />
        <asp:Parameter Name="timeAnchor" Type="Int32" />
        <asp:Parameter Name="Role" Type="Int32" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="UserName" Type="String" />
        <asp:Parameter Name="PassWord" Type="String" />
        <asp:Parameter Name="Tails" Type="String" />
        <asp:Parameter Name="LinkUps" Type="String" />
        <asp:Parameter Name="timeAnchor" Type="Int32" />
        <asp:Parameter Name="Role" Type="Int32" />
        <asp:Parameter Name="UserID" Type="String" />
    </UpdateParameters>
</asp:SqlDataSource>
<br />
<asp:TextBox ID="TextBox1" runat="server" Width="190px"></asp:TextBox>
&nbsp;<asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
    Text=" 生成新用户" />
&nbsp;
</asp:Content>
